home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / etc / bash_completion.d / sitecopy < prev    next >
Encoding:
Text File  |  2010-11-16  |  1.0 KB  |  41 lines

  1. # sitecopy(1) completion
  2. # Copyright 2003 Eelco Lempsink <eelcolempsink@gmx.net>
  3. # License: GNU GPL v2 or later
  4.  
  5. have sitecopy &&
  6. _sitecopy()
  7. {
  8.     local cur
  9.  
  10.     COMPREPLY=()
  11.     _get_comp_words_by_ref cur
  12.  
  13.     case $cur in
  14.         --*)
  15.             COMPREPLY=( $( compgen -W "$(sitecopy -h | command grep -e '--\w' |\
  16.                 awk '{sub (/=(FILE|PATH)/, "", $2); print $2}')" -- "$cur" ) )
  17.             ;;
  18.         -*)
  19.             COMPREPLY=( $( compgen -W "$(sitecopy -h | command grep -e '-\w' | \
  20.                 awk '{sub (",", "", $1); print $1}')" -- "$cur" ) )
  21.             ;;
  22.         *)
  23.             if [ -r ~/.sitecopyrc ]; then
  24.                 COMPREPLY=( $( compgen -W "$(command grep '^["$'\t '"]*site' \
  25.                     ~/.sitecopyrc | awk '{print $2}')" -- "$cur" ) )
  26.             fi
  27.             ;;
  28.     esac
  29.  
  30.     return 0
  31. } &&
  32. complete -F _sitecopy -o default sitecopy
  33.  
  34. # Local variables:
  35. # mode: shell-script
  36. # sh-basic-offset: 4
  37. # sh-indent-comment: t
  38. # indent-tabs-mode: nil
  39. # End:
  40. # ex: ts=4 sw=4 et filetype=sh
  41.